<template>
  <div>
    <template>
      <template v-if="isShowWelthManager&&tableData.WEALTH.totalCount > 0">
        <h4>产品</h4>
        <ListProduct class="list-wrap" :max="5" :data="tableData.WEALTH.list"/>
      </template>
      <template v-if="isShowResearch&&tableData.researchData.totalCount > 0">
        <h4>研究</h4>
        <listResearch class="list-wrap" :max="5" :data="tableData.researchData.list"/>
      </template>
      <template v-if="tableData.bonddata.totalCount > 0">
        <h4>债券</h4>
        <ListBond class="list-wrap" :max="5" :data="tableData.bonddata.list"/>
      </template>
      <template v-if="tableData.managerdata.totalCount > 0||tableData.publisherdata.totalCount > 0">
        <h4>公司</h4>
        <ListManager :max="5" :data="tableData.managerdata.list" v-if="isShowWelthManager"/>
        <ListPublisher :max="5" :data="tableData.publisherdata.list"/>
      </template>
      <template v-if="tableData.discoverdata.totalCount > 0">
        <h4>发现</h4>
        <ListDiscover :max="5" :data="tableData.discoverdata.list"/>
      </template>
    </template>
    <template v-if="totalCount == 0">
      <el-empty></el-empty>
    </template>
  </div>
</template>

<script>
import ListProduct from '../components/ListProduct';
import listResearch from '../components/listResearch';
import ListReport from '../components/ListReport';
import ListChart from '../components/ListChart';
import ListActivity from '../components/ListActivity';
import ListIndividuate from '../components/ListIndividuate';
import ListCollection from '../components/ListCollection';
import ListBond from '../components/ListBond';
import ListManager from '../components/ListManager';
import ListPublisher from '../components/ListPublisher';
import ListDiscover from '../components/ListDiscover';
import { newverifyRoles } from '@/utils/verify';
export default {
  components: {
    ListProduct,
    listResearch,
    ListReport,
    ListChart,
    ListActivity,
    ListIndividuate,
    ListCollection,
    ListBond,
    ListManager,
    ListPublisher,
    ListDiscover
  },
  props: {
    tableData: {
      type: Object,
      default: function () {
        return [];
      }
    },
    totalCount: {
      // eslint-disable-next-line vue/require-prop-type-constructor
      type: String | Number,
      default: 0
    }
  },
  data () {
    return {
      searchType: 'all',
      isShowWelthManager: true,
      isShowResearch: true
    };
  },
  mounted () {
    this.isShowWelthManager = newverifyRoles('xst');
    this.isShowResearch = newverifyRoles('research');
  }
};
</script>
<style lang="scss" scoped>
::v-deep .el-empty{
  padding: 0;
  .el-empty__image{
    width: 140px;
  }
}
h4{
  font-style: normal;
  font-size: 16px;
  color: #2468F2;
  margin-bottom:15px;
}
.list-wrap{
  margin-bottom: 17px;
}
</style>
